package c.j.a.d.b.m;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

/* compiled from: DefaultThreadFactory */
public class a implements ThreadFactory {
    public final String a;
    public final AtomicInteger b = new AtomicInteger();
    public final boolean c;

    public a(String str) {
        this.a = str;
        this.c = false;
    }

    public Thread newThread(Runnable runnable) {
        int incrementAndGet = this.b.incrementAndGet();
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(this.a);
        stringBuilder.append("-");
        stringBuilder.append(incrementAndGet);
        Thread thread = new Thread(runnable, stringBuilder.toString());
        if (!this.c) {
            if (thread.isDaemon()) {
                thread.setDaemon(false);
            }
            if (thread.getPriority() != 5) {
                thread.setPriority(5);
            }
        }
        return thread;
    }

    public a(String str, boolean z) {
        this.a = str;
        this.c = z;
    }
}
